<?php


namespace app\api\validate;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        'username|用户名' => 'require',
        'phone_number|手机号' => 'require|mobile',
        'code|手机验证码' => 'require|number|min:4',
        'type|类型' => 'require|in:1,2',
        'sex|性别'=> 'require|in:0,1,2'
    ];

    protected $scene = [
        'send_code' => ['phone_number'],
        'login' => ['phone_number', 'code', 'type'],
        'update_user' => ['username', 'sex'],
    ];
}